package com.example.farm.mapper;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.example.farm.Bean.Land;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 姚
 * @since 2023-04-15
 */

@Mapper
public interface LandMapper extends BaseMapper<Land> {

    //增
    @Override
    int insert(Land land);
    //改
    int update(Land land, UpdateWrapper<Land> updateWrapper);


    //查所有的土地
    @Select("select * from land")
    ArrayList<Land> selectAll();

    //根据uid查找土地
    @Select("select * from land where OwnerUid = #{OwnerUid}")
    ArrayList<Land> selectByOwnerUid(String OwnerUid);

}
